import request from '@/utils/request'

// 获取房产列表
export function propertiesList(params) {
  return request({
    url: '/properties',
    params
  })
}

// 获取房产数量
export function properCount(params) {
  return request({
    url: '/properties/count',
    params
  })
}

// 获取指定房产
export function properDetails(id) {
  return request({
    url: `/properties/${id}`
  })
}

// 新建房产
export function addProper(data) {
  return request({
    url: '/properties',
    method: 'post',
    data
  })
}

// 编辑房产
export function updateProper(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'put',
    data
  })
}

// 删除房产
export function deleteProper(id) {
  return request({
    url: `/properties/${id}`,
    method: 'delete'
  })
}
